<template>
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div >
          <div class="details-title">{{$t('zz.product_presentation')}}</div>
          <zz-card>
            <p slot="content">{{$t('zz.server.vulnerability.intro')}}</p>
            <img
              src="@/assets/img/vulnerability/vulnerability1-1.png"
              slot="img"
              alt=""
              width="430"
            />
          </zz-card>
        </div>
        <div>
          <div class="details-title">{{$t('zz.characteristic_service')}}</div>
          <div class="flex-3">
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name1')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro1')}}</p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-1.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name2')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro2')}}</p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-2.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name3')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro3')}}</p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-3.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name4')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro4')}} </p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-4.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name5')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro5')}}</p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-5.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.vulnerability.characteristic_service.name6')}}</span>
                <p slot="content">{{$t('zz.server.vulnerability.characteristic_service.intro6')}}</p>
                <img
                  src="@/assets/img/vulnerability/vulnerability2-6.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
          </div>
        </div>
        <div style="min-height: 400px;">
          <div class="details-title">{{$t('zz.application_scenarios')}}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper" style="width:600px">
              <li
                v-for="(item, i) in list[2].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{  item.name}}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 1">
            <img :src="$t('zz.img.vulnerability3-1')" alt="" />
            <div style="height:20px"></div>
<p> {{$t('zz.server.vulnerability.characteristic_service.use.intro1')}}</p>
          </div>
          <div v-if="subIndex == 2">
            <img :src="$t('zz.img.vulnerability3-2')" alt="" />
            <div style="height:20px"></div>
            <p>{{$t('zz.server.vulnerability.characteristic_service.use.intro2')}}</p>
          </div>
          <div v-if="subIndex == 3">
            <img :src="$t('zz.img.vulnerability3-3')" alt="" />
            <div style="height:20px"></div>
            <p>{{$t('zz.server.vulnerability.characteristic_service.use.intro3')}}</p>
          </div>
          <div v-if="subIndex == 4">
            <img :src="$t('zz.img.vulnerability3-4')" alt="" />
            <div style="height:20px"></div>
            <p>{{$t('zz.server.vulnerability.characteristic_service.use.intro4')}}</p>
          </div>
          <div v-if="subIndex == 5">
            <img :src="$t('zz.img.vulnerability3-5')" alt="" />
            <div style="height:20px"></div>
            <p>{{$t('zz.server.vulnerability.characteristic_service.use.intro5')}}</p>
          </div>
          <div v-if="subIndex == 6">
            <img :src="$t('zz.img.vulnerability3-6')" alt="" />
            <div style="height:20px"></div>
            <p>{{$t('zz.server.vulnerability.characteristic_service.use.intro6')}}</p>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import { mapGetters } from 'vuex'

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
      height: 260,
      titleSize: 20,
      
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    ...mapGetters({
      isPC: 'isPC'
    }),
    list: function(){return [
        { name: this.$t('zz.product_presentation'), index: 1, title: this.$t('zz.product_presentation') },
        { name: this.$t('zz.characteristic_service'), index: 2 },
        {
          name: this.$t('zz.application_scenarios'),
          index: 3,
          child: [
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name1"), index: 1, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name1.little") },
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name2"), index: 2, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name2.little") },
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name3"), index: 3, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name3.little") },
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name4"), index: 4, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name4.little") },
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name5"), index: 5, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name5.little") },
            { name: this.$t("zz.server.vulnerability.characteristic_service.use.name6"), index: 6, pcname: this.$t("zz.server.vulnerability.characteristic_service.use.name6.little") },
          ],
        },
      ]},
  },
  watch: {},
  methods: {
    navClick(a_item) {
      console.log(a_item);
      this.subIndex = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
    max-width: 100%;
  }
  & > ul {
    width: auto;
    margin: 0 auto;
  }
}
.son-pro-wrap {
  display: flex;
  // justify-content: space-between;
  margin-top: 48px;
  flex-wrap: wrap;
  & > div {
    width: 240px;
    margin-right: 40px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 22px;
        line-height: 32px;
        margin: 15px 0 20px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 25px;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
.list-has-poi {
  list-style-type: disc;
  li {
    list-style-type: disc;
  }
}
</style>